<template>
	<view class="" style="background-color: #d70127;">
		<view class="content">
			<view class="item">
				<view class="df-flex" style="align-items: center;">
					<image :src="newInfo.cover" mode=""></image>
					<view class="text"> {{newInfo.title }} </view>
				</view>
				<view class="time">
					{{newInfo.createTime}}
				</view>
			</view>
			<view class="">
				<rich-text :nodes="newInfo.textRemark" style="color: #fff;"></rich-text>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		newById
	} from '../request/api.js'
	export default {
		data() {
			return {
				id: 0,
				newInfo: {}
			}
		},
		onLoad(opt) {
			this.id = opt.id
		},
		onShow() {
			this.getNewInfo()
		},
		methods: {
			getNewInfo() {
				newById({
					id: this.id
				}).then(res => {
					if (res.code == 200) {
						this.newInfo = res.result
					}
				})
			}
		}
	}
</script>
<style lang="scss">
	.content {
		height: 100vh;
		background: url('/static/image/bg.png') no-repeat center center;
		background-size: 100% 100%;
		padding: 100rpx 30rpx 200rpx;
		overflow: hidden;

		.item {
			margin-top: 30rpx;
			border-bottom: 1px solid #fff;
			padding-bottom: 20rpx;

			image {
				width: 100rpx;
				height: 100rpx;
			}

			.text {
				color: #FDE8CE;
				margin-left: 20rpx;
			}

			.time {
				color: #FDE8CE;
				text-align: right;
			}
		}
	}
</style>